<template>
  <div class="home">
    <f-table :table="table" :columns="columns" showPagination></f-table>
  </div>
</template>

<script>
export default {
  name: "HomeView",
  data() {
    return {
      // table 配置数据
      table: {
        // 总数
        total: 20,
        // 当前页
        currentPage: 1,
        // pageSize
        pageSize: 10,
        // 第一列的类型 type类型
        // type
        // width
        // label
        // fixed
        // align
        firstColumn: { type: "index", width: "80", label: "序号" },
        data: [
          {
            id: "1",
            date: "2016-05-02",
            name: "王小虎1",
            status: "2",
            address: "上海市普陀区金沙江路 1517 弄",
          },
          {
            id: "2",
            date: "2016-05-02",
            name: "王小虎2",
            status: "1",
            address:
              "上海市普陀区金沙江路 1519 弄上海市普陀区金沙江路 1519 弄上海市普陀区金沙江路 1519 弄",
          },
          {
            id: "3",
            date: "2016-05-02",
            name: "王小虎3",
            status: "3",
            address: "上海市普陀区金沙江路 1516 弄",
          },
        ],
      },
      // 表头数据
      columns: [
        { prop: "name", label: "姓名", minWidth: "100" },
        { prop: "date", label: "日期", minWidth: "180", sort: true },
        {
          prop: "address",
          label: "地址",
          minWidth: "120",
          sort: true,
          noShowTip: true,
          // eslint-disable-next-line no-unused-vars
          render: (text, row, index) => {
            return <span>render</span>
          },
        },
        { prop: "date", label: "日期", minWidth: "180", sort: true },
        {
          prop: "address",
          label: "地址",
          minWidth: "220",
          headerRequired: true,
        },
      ],
    }
  },
  methods: {
    btnClick() {
      console.log("===btnClick===")
    },
  },
}
</script>
